from django.core.mail import send_mail
from celery import task
from time import sleep
from md_shop_pro.settings import DEFAULT_FROM_EMAIL
import django
django.setup()

@task
def send_reset_email(email,token):
    sub = '欢迎你'
    message = '''
            请点击该链接重置密码:\r\n
            http://127.0.0.1:8080/#/resetpass?token=%s
        '''% token
    try:
        send_mail(sub,message,DEFAULT_FROM_EMAIL,[email])
    except:
        pass